		

		// 初始化基本js信息
		
		var $all = $('body,html');
		
		var h = $(window).height();

		var bh =h/2+"px";
		
		var $mcover = $("#mcover");
		
		var $content = $("#content");
		
		$mcover.height(h+"px");
		
		$content.height(h+"px");
		
		$content.css("min-height",h);
		
//		alert(h);
		
		
		//toast提示框   试例调用  new Toast({context:$('body'),message:'Toast效果显示'}).show();
		
		
		var Toast = function(config){  
		    this.context = config.context==null?$('body'):config.context;//上下文  
		    this.message = config.message;//显示内容  
		    this.time = config.time==null?3000:config.time;//持续时间  
		    this.left = config.left;//距容器左边的距离  
		    this.top = config.top;//距容器上方的距离  
		    this.init();  
		}  
		var msgEntity;  
		Toast.prototype = {  
		    //初始化显示的位置内容等  
		    init : function(){  
		        $("#toastMessage").remove();  
		        //设置消息体  
		        var msgDIV = new Array();  
		        msgDIV.push('<div id="toastMessage">');  
		        msgDIV.push('<span>'+this.message+'</span>');  
		        msgDIV.push('</div>');  
		        msgEntity = $(msgDIV.join('')).appendTo(this.context);  
		        //设置消息样式  
		        var left = this.left == null ? '50%': this.left;  
		        var top = this.top == null ? '40%' : this.top; 
		        var margin_left = msgEntity.find('span').width()/2+10;
		        msgEntity.css({position:'fixed',top:top,'z-index':'99',left:left,'background-color':'gray',color:'white','font-size':'14px',padding:'10px',margin:'10px','margin-left':-margin_left});  
		        msgEntity.hide();
		        
		    },  
		    //显示动画  
		    show :function(){  
		        msgEntity.fadeIn(1000);
		        setTimeout("msgEntity.fadeOut(1000)",this.time);
		        
		    }  
		          
		}  
		
		//显示toast
		function showToast(msg)
		{
			//alert(1);
			new Toast({message:msg}).show();
		}
		
		//隐藏toast
		function hideToast()
		{
			msgEntity.fadeOut(1000);
		}
		
		
		//花瓣加载效果
        var opts = {            
            lines: 10, // 花瓣数目
            length: 5, // 花瓣长度
            width: 3, // 花瓣宽度
            radius: 5, // 花瓣距中心半径
            corners: 1, // 花瓣圆滑度 (0-1)
            rotate: 0, // 花瓣旋转角度
            direction: 1, // 花瓣旋转方向 1: 顺时针, -1: 逆时针
            color: 'black', // 花瓣颜色
            speed: 1, // 花瓣旋转速度
            trail: 60, // 花瓣旋转时的拖影(百分比)
            shadow: false, // 花瓣是否显示阴影
            hwaccel: false, //spinner 是否启用硬件加速及高速旋转            
            className: 'spinner', // spinner css 样式名称
            zIndex: 2e9, // spinner的z轴 (默认是2000000000)
            top: bh, // spinner 相对父容器Top定位 单位 px
            left: '50%'// spinner 相对父容器Left定位 单位 px
        };

        var spinner = new Spinner(opts);
		var target = document.getElementById('spin');
		
		
		//显示加载效果
		function showSpin()
		{
			
			
			spinner.spin(target);
			//.show();
		}
		
		
		//隐藏加载效果
		function hideSpin()
		{
			spinner.spin();
			//$mcover.hide();
		}
		
		
		
		//页面切换成功回调
		function routeChangeSuccess(event) {  
			
			
			
			
	    } 
		
		
		var loading = document.querySelector('#loading');
		var showMsg = document.querySelector('#msg');
		// loadming提示
		function showMsg(msg)
		{
			showMsg.html(msg);
			loading.style.display = 'block';
			setTimeout(function(){
				loading.style.display = 'none';
			},1500);
		}
		
		
		// 恢复底部菜单以及右下方菜单初始状态
		
		var submenu = $('.sub-menu');
		var imore = $('.icon-more');
		var ileft = $('.icon-left');
	
		var ihidden = $('.icon-hidden');
		var icart = $('.icon-cart');
		var ihome = $('.icon-home');
		var ishop = $('.icon-shop');
		var imap = $('.map-left');
		
		function defaultMenu()
		{
			
			
		
//			setTimeout("$all.animate({scrollTop:0},1000)",200);
			//$all.animate({scrollTop:0},1000); 
			submenu.removeClass('active').css({bottom:'-500px',opacity:'0'});
			
			
			ileft.show();
			imap.show();
			imore.removeClass('active');
			ihidden.css({zIndex:'-1',opacity:'0'});
			imore.css({background:'url("images/icon-more.png") no-repeat center center black',backgroundSize:'23px 6px'});
			ihome.css('webkitTransform','translate3d(0,0,0)');
			icart.css('webkitTransform','translate3d(0,0,0)');
			ishop.css('webkitTransform','translate3d(0,0,0)');
			//imap.css('webkitTransform','translate3d(0,0,0)');
		}
		
		
		var tabview = $("#tabview");
		
		var circle = $("#circle-icon");
		
		var mmap = $("#map-icon");
		//底部菜单
		function bottomMenu()
		{
			defaultMenu();
			tabview.show();
			circle.hide();
			mmap.hide();
		}
		
		
		//右下角菜单
		function rightMenu()
		{
			defaultMenu();
			tabview.hide();
			mmap.hide();
			circle.show();
//			$(".circle-left").show();
		}
		
		//店面列表菜单
		function mapMenu()
		{
			defaultMenu();
			tabview.hide();
			mmap.show();
			circle.hide();
//			$(".circle-left").show();
		}
		
		//隐藏菜单
		function hideMenu()
		{
			tabview.hide();
			circle.hide();
			mmap.hide();
//			$(".circle-left").show();
		}
		
			//右下方悬浮菜单
			imore.click(function(event) {
			
				ileft.toggle();
				imap.toggle();
				$(this).toggleClass('active');
				if($(this).hasClass('active')){
					ihidden.css({zIndex:'997',opacity:'1'});
					imore.css({background:'url("images/icon-del.png") no-repeat center center black',backgroundSize:'20px 20px'});
					ihome.css('webkitTransform','translate3d(7px,-56px,0)');
					ishop.css('webkitTransform','translate3d(-42px,-39px,0)');
					//imap.css('webkitTransform','translate3d(-51px,11px,0)');
					icart.css('webkitTransform','translate3d(-51px,11px,0)');
				}
				else{
					ihidden.css({zIndex:'-1',opacity:'0'});
					imore.css({background:'url("images/icon-more.png") no-repeat center center black',backgroundSize:'23px 6px'});
					ihome.css('webkitTransform','translate3d(0,0,0)');
					icart.css('webkitTransform','translate3d(0,0,0)');
					ishop.css('webkitTransform','translate3d(0,0,0)');
					//imap.css('webkitTransform','translate3d(0,0,0)');
				}
			});
			
			//var overlay = $('#content');
			//底部菜单
			var fmenu = $('div.fmenu');
			fmenu.on('click',function(event) {
				
				var $subMenu=$(this).find('.sub-menu');
				//overlay.fadeToggle('fast');
				if($subMenu){
					
					$(this).siblings().find('.sub-menu').removeClass('active').css({bottom:'-500px',opacity:'0'});
					if($subMenu.hasClass('active')){
						$subMenu.removeClass('active').css({bottom:'-500px',opacity:'0'});
					}
					else{
						
						$subMenu.addClass('active').css({bottom:'53px',opacity:'1'});
					}
				}
			});
		
			function retSetMenu(){
				
				fmenu.siblings().find('.sub-menu').removeClass('active').css({bottom:'-500px',opacity:'0'});
				}
			
			
			//轮播resize
			 function initBox()
			 {
				
				
//				var swiper = new Swiper('.swiper-container', {
//			        pagination: '.swiper-pagination',
//			       
//			        slidesPerView: 1,
//			        paginationClickable: true,
//			        spaceBetween: 30,
//					autoplay:2000
//	
//			    });
				 var swiper = new Swiper ('.swiper-container', {
			    	 	autoplay: 3000,
			    		loop: true,
					    pagination: '.swiper-pagination'
			  		}); 

			 }
			
			
			 
			 function initHtmlImg()
			 {
				 
				 $(".img-full img").css({'width':'100%'});
			 }
	
			 function errorMy(params){
				 	if($(params).attr('error_url')){
				 		$(params).attr("src",$(params).attr('error_url'));
				 	}
				}
			 
			 function showAlert(msg){
				 showToast(msg);
					//alert(msg);
			}
			 function showNull(){
				 $("#showNull").show();
			 }
			 function hideNull(){
				 $("#showNull").hide();
			 }
			 function showConfirm(msg,callback,cancelback){
					if(confirm(msg))
					{
						if( typeof callback === 'function' ){
							callback();
						}else{
						    //不存在或不是function
						}
					}else{
						cancelback();
					}
//					$('.t_submit2').unbind("click");
//					$('.t_submit2').click(function(){
//						if( typeof callback === 'function' ){
//							callback();
//						}else{
//						    //不存在或不是function
//						}
//						$('.zhezhao2').hide('fast');
//						$('.t_submit2').unbind("click");
//						$('.t_submit2').click(function(){
//							$('.zhezhao2').hide('fast');
//						});
//					});
//					$("#msg2").html(msg);
//					$('.zhezhao2').show("fast");
				}
			 
			 function initFooter(index)
			 {
				 var iconPath=$('footer>.active').find('img').attr('src');
				 //清除原来的
				 if(iconPath!=undefined&&iconPath!=null&&iconPath!="")
				 {
					 iconPath=iconPath.slice(0,-5)+'.png';
					 $('footer>.active').find('img').attr('src',iconPath);
					 $('footer>div').removeClass('active');
				 }
				 
				 $('footer>div').eq(index).addClass('active');
			 	var iconPath=$('footer>.active').find('img').attr('src');
			 	iconPath=iconPath.slice(0,-4)+'2.png';
				$('footer>.active').find('img').attr('src',iconPath);
				tabview.show();
			 }
			 
			 function isFooter(){
				 var a = document.documentElement.scrollTop == 0 ? document.body.clientHeight : document.documentElement.clientHeight;
		        var b = document.documentElement.scrollTop == 0 ? document.body.scrollTop : document.documentElement.scrollTop;
		        var c = document.documentElement.scrollTop == 0 ? document.body.scrollHeight : document.documentElement.scrollHeight;
		 
		 
		        if (b != 0) {
		            if (a + b == c) {
		            	return true;
		            }
		        }
		        return false;
			 }
			 
			 function jq_load(){
				 $(".img-load").lazyload({
				 		threshold : 100,
				 		effect : "fadeIn",
				 		failure_limit : 10,
				 		
				 	});
			 }
			 
			function lazyloadImage(){
				$('.lazy').lazyload({
				   	effect : "fadeIn",
				   	threshold : 100,
				   	placeholder : "../images/o6.png", //加载图片前占位
				   	failure_limit : 10
				});
			}
			
			function lazyloadPage(cas){
				$('.'+cas).lazyload({
				   	effect : "fadeIn",
				   	threshold : 100,
				   	placeholder : "../images/o6.png", //加载图片前占位
				   	failure_limit : 10
				});
			}
			
			
			
			 
			 
			 function btnScroll(){
					var winH = $(window).outerWidth(true);
					
//					alert(window.screen.width);
//					alert(winH);
//					alert(22);
					$('.btn-con-scroll').css({
						'padding-left' : winH * 0.01,
						'padding-right' : winH * 0.01
					})
					$('.btn-con-scroll .btn').css({
						'width': winH * 0.23,
						'padding-left' : winH * 0.01,
						'padding-right' : winH * 0.01
					});
					
					
				}
			 
			 
			 function initClick(){
					//会员中心导航+社区
					$('.tab-section > .ub-f1').eq(1).click(function(){
						$(this).addClass('active').siblings().removeClass('active').parent().next().addClass('moveactiveleft').removeClass('moveactiveright');
						$('.tab2').removeClass('hide').siblings().addClass('hide');
					})
					$('.tab-section > .ub-f1').eq(0).click(function(){
						$(this).addClass('active').siblings().removeClass('active').parent().next().addClass('moveactiveright').removeClass('moveactiveleft');
						$('.tab1').removeClass('hide').siblings().addClass('hide');
					})
			}
				
